//
//  ST_UserManager.h
//  ST_BaseMall
//
//  Created by 昱胜 on 2022/9/2.
//

#import <Foundation/Foundation.h>
#import "ST_UserInfo.h"

NS_ASSUME_NONNULL_BEGIN

@interface ST_UserManager : NSObject

@property (strong, nonatomic,readonly) ST_UserInfo *user;
@property (strong, nonatomic,readonly) ST_UserRCModel *rcUser;
/* refresh_token */
@property (nonatomic, copy) NSString * __nullable refresh_token;
/* access_token */
@property (nonatomic, copy) NSString * __nullable access_token;

/* other_token */
@property (nonatomic, copy) NSString * __nullable other_token;

/* isLogin */
@property (nonatomic, assign) BOOL isLogin;

+ (instancetype)shareInstance;

//是否登录
+ (BOOL)alreadyLogin;

//更新个人信息
+ (void)uploadUserModelWithKey:(NSString *)key Value:(NSString *)Value;

//保存token
- (void)saveAccountInfoWithAccessToken:(NSString *)accessToken RefreshToken:(NSString *)refreshToken;

//请求个人信息
- (void)loadUserInfoComplate:(void(^)(void))complate;

//请求融云信息
- (void)loadRcUserInfoComplate:(void(^)(void))complate;

//请求三方网页登录信息
- (void)loadOtherTokenComplate:(void(^)(void))complate;

/**
 *  写入当前用户
 */
+ (BOOL)saveUserModel:(ST_UserInfo *)user;

/**
 *  写入当前融云用户
 */
+ (BOOL)saveRCUserModel:(ST_UserRCModel *)rcUser;

//登录
+ (void)gotoLogin;

//退出登录
+ (void)logOut ;

@end

NS_ASSUME_NONNULL_END
